﻿@{
    ViewBag.Title = "标签品牌设置";

}
@section styles{
    <link href="~/static/css/client.css" type="text/css" rel="stylesheet" />
    <link href="~/static/css/system.css" type="text/css" rel="stylesheet" />
    <link href="~/static/css/contract.css" type="text/css" rel="stylesheet" />
}
<style>
    a {
        text-decoration: none;
    }

    .brand_logo {
        width: 28px;
        height: 28px;
    }

    .hidden {
        display: none;
    }

    .layui-upload-img {
        max-width: 300px;
        max-height: 200px;
    }
</style>
<div class="layui-fluid layui-content">
    <div class="layui-title layui-clear layui-row">
        <h2 class="layui-col-md10 layui-col-sm9 layui-col-xs7">@ViewBag.Title</h2>
    </div>
    <div class="layui-eacher layui-row layui-clear">
    </div>
    <div class="layui-data layui-table-container">

        <table class="layui-hide layui-table" id="layui-table" lay-filter="table"></table>
    </div>
</div>
<div id="Layer_ajax" class="deploy-plus"></div>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="set">设置</a>
</script>
@section scripts{

    <script src="~/static/js/jquery.ztree.core.js" type="text/javascript"></script>
    <script src="~/static/js/jquery.ztree.excheck.js" type="text/javascript"></script>
    <script src="~/static/js/jquery.ztree.exedit.js" type="text/javascript"></script>
    <script src="~/js/main.js"></script>

    <script type="text/javascript">

        var layer, form, table;
        layui.use(['form', 'layedit', 'table', 'layer'], function () {
            var /*form = layui.form*/
                layedit = layui.layedit;

            layer = layui.layer
            form = layui.form;
            table = layui.table;

            table.render({
                elem: "#layui-table",
                url: '/Tag/GetTagData',
                where: { tagType: "品牌" },
                cellMinWidth: 26,
                height: 'full-150',
                cols: [[
                    { type: 'checkbox' },
                    { field: 'tagName', title: '标签' },
                    { title: '操作', width: 213, align: 'center', toolbar: '#barDemo' }
                ]],
                id: "idTest",
                page: true,
                size: "lg"
            });


            //监听工具条
            table.on('tool(table)', function (obj) {
                var data = obj.data;
                if (obj.event === 'set') {
                    top.NewTab('46', '标签品牌设置', '/Tag/SetBrands?tagid='+data.id)
                }
            });
        });


        $("#layui-Area").click(function () {
            $(".layui-Area .layui-Area-hide").toggleClass("layui-Area-show")
            $(this).parent(".layui-form-select").toggleClass("layui-form-selected");
        });

        $(".layui-Area").mouseleave(function () {
            $(".layui-Area .layui-Area-hide").removeClass("layui-Area-show")
        })


        $(document).ready(function () {

        });

        function LayerOpen(title, url) {
            var open = layer.open({
                type: 2,
                title: title,
                shadeClose: true,
                shade: false,
                maxmin: true, //开启最大化最小化按钮
                area: ['400px', '250px'],
                content: url,
                success: function (layero, index) {
                    var body = layer.getChildFrame('body', index)//确定两个页面的父子关系
                },
                end: function () {
                    //销毁后重新加载
                    table.reload('idTest', {
                        page: {
                            curr: 1 //重新从第 1 页开始
                        }
                    })
                }
            });
        }

        function ReloadAjaxCallbackgoback(data, successInfo) {
            CommonAjaxCallback(data, function () {
                table.reload('idTest', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                })
            }, successInfo)
        }
    </script>
}